<%--
    Document   : listdvt
    Created on : Nov 9, 2011, 4:16:08 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT,Models.ThamSoHT_Model"%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->
<script type="text/javascript">

</script>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'notice', 'order', 'rightmsg',  'optionlist', 'optionname' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.
            
            String notice = mdsts[0].getTenTS();            
            String optionlist = mdsts[1].getTenTS();
            String optionname = mdsts[2].getTenTS();
            String order = mdsts[3].getTenTS();
            String rightmsg = mdsts[4].getTenTS();
            
            String msgright = notice + "/" + rightmsg;
            Vector v = (Vector) request.getAttribute("DSTC");

            int numpage = 0;// khởi tạo số trang = 0
            int vsize = v.size();
            if (vsize % 6 == 0) // mỗi trang có 6 dòng
            {
                numpage = vsize / 6;
            } else {
                numpage = vsize / 6 + 1;
            }
            String xx = (String) request.getAttribute("item"); // trang hiện tại đang xem
            int item = Integer.parseInt(xx);
            String tentc = (String) request.getAttribute("tentc");
%>
<div class="title">
        <%=optionlist%>
        
    </div>
    <div class="content">
        <form name="dstuychon" action="">
            <table class="mytable" border="0" cellpadding="0" cellspacing="0">
                <thead>
                    <tr>
                        <th style="width: 10%;  padding-left: 30px; "><%=order%></th>
                        <th style="width: 8%; ">
                            <a href="#" id="titledskv1" style="margin-top: 5px;" class="down" lang="<%=msgright%>"   name="1" onclick="SortSearchTenTC(this.className, this.name, this.lang)">
                                <div style="float:left"><%=optionname%></div>
                                <div id="sortkv1" style=" margin-right: 100px;" class="down1"></div>
                            </a>
                        </th>
                    </tr>
                    <tr id="searchTC">
                        <th style=" padding-left: 30px;"><img style=" margin-top: 2px; margin-left: 3px; margin-bottom: -7px; cursor: pointer;" lang="<%=msgright%>"    alt="1" src="../images/search1.png" onclick="SearchTC(this.alt, this.lang)"></th>
                        <th><input type="textbox" style=" width: 130px;" class="text" value="<%=tentc %>" name="TENTC" ></th>

                    </tr>
                </thead>
                <tbody>
                    <%
                        for (int i = (item - 1) * 6; i < (item - 1) * 6 + 6 && i < vsize; i++) {
                            Beans.TuyChon tc = (Beans.TuyChon) v.elementAt(i);
                    %>
                    <tr>
                        <td style="padding-left: 40px; "><%= i + 1%></td>
                        <td class="TenKV"><a href="#" name="<%=tc.getMaTC()  %>" lang="<%=msgright%>"  onclick="ShowLangTC(this.name, this.lang)"><%= tc.getTenTC() %></a></td>

                    </tr>
                    <%  }
                    %>
                </tbody>
            </table>
            <div class="pagination" style=" margin-top: 20px;">
                <%
                    int trang = 1;
                    if (item > 1) {
                        trang = item - 1;
                    }
                %>
                <%
                    if (vsize > 6) {%>
                        <a href="#" class="prev"  name="<%= trang%>" lang="<%=msgright%>" onclick="SearchTC( this.name, this.lang)">«</a>
                <%
                        for (int c = 1; c <= numpage; c++) {
                            if (c != item) {
                %>              <a href="#"  name="<%= c%>" lang="<%=msgright%>" onclick="SearchTC( this.name, this.lang)" ><%= c%></a>
                <%          } else {%><a class="current"> <%= c%></a> <% }
                        }
                %>
                <%      if (item + 1 <= numpage) {
                            trang = item + 1;
                        } else {
                            trang = item;
                        }
                %>
                        <a href="#" class="next"  name="<%= trang%>" lang="<%=msgright%>" onclick="SearchTC( this.name, this.lang)">»</a>
                <%  }
                %>
            </div>
        </form>
    </div>
